package com.zhuss.car.driver;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.car.driver.DetailDriverBo;
import com.zhuss.bean.bo.car.driver.SearchDriverBo;
import com.zhuss.car.processor.DriverRead;
import com.zhuss.car.processor.cache.DriverCache;
import com.zhuss.common.ReadService;
import com.zhuss.exception.DzcxException;

/**
 * @description: 司机查询Service
 * @author: zhushanshuo
 * @create: Mon Dec 21 13:31:45 CST 2020
 **/
@Component("driverReadService")
public class DriverReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("driverRead")
	private DriverRead driverRead;

	@Autowired
	@Qualifier("driverCache")
	private DriverCache driverCache;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailDriverBo bo = (DetailDriverBo) param;
		Long driverId = bo.getDriverId();
		Object vo = driverRead.detail(driverId);
		return vo;
	}

	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) throws DzcxException {
		SearchDriverBo bo = (SearchDriverBo) param;
		Object result = driverRead.list(bo);
		return result;
	}

	/**
	 * 下拉驾驶员
	 */
	public Object select(SearchDriverBo bo) throws DzcxException {
		Object result = driverRead.select(bo);
		return result;
	}

}

